package behavioralPattern.mediator.example01;

/**
 * 抽象同事类
 */
public abstract class Colleague {
    // 维护一个中介对象
    private Mediator mediator;

    public Colleague(Mediator mediator) {
        this.mediator = mediator;
    }

    // 获取中介对象
    public Mediator getMediator() {
        return mediator;
    }

    // 同事间进行交互的抽象方法
    public abstract void exec(String key);
}
